package com.nuanshui.heatedloan.module.dal.mapper;

import java.util.List;

import com.nuanshui.heatedloan.module.model.ModuleForm;
import org.apache.ibatis.annotations.Param;

import com.nuanshui.heatedloan.module.model.Feature;
import com.nuanshui.heatedloan.module.model.FeatureItem;
import com.nuanshui.heatedloan.module.model.Module;

public interface ModuleMapper {

	/**
	 * 
	 * @param moduleId
	 * @param isEditRequest  如果不是后台的编辑操作，那么就都给0
	 * @return
	 */
    Module getModuleWithFeatureById(@Param("form") ModuleForm form);
	
	List<Feature> getBaseModuleList(Integer moduleId);
	
	Feature getFeatureByFeatureId(@Param("featureId") String featureId);
	
	/**
	 * 这里获取的item是没有图片的，图片的数据获取，在FeatureManager 里面的 afterHandleFeatureItem 方法里面完成的
	 * @author Gonzo
	 * @date 2016年12月27日下午8:38:38
	 * @param featureId
	 * @return
	 * @since 1.0.0
	 */
    List<FeatureItem> getFeatureItems(Integer featureId);
	
	List<Module> getAllModule();
	
	void addFeatureByTypeId(@Param("feature") Feature feature);
	
	void deleteFeatureByFeatureId(@Param("featureId") String featureId);
	
	void updateFeature(@Param("feature") Feature feature);
	
	List<Feature> findFeatureItemByFeatueId(@Param("featureId") Integer featureId);
	
	void deleteFeatureItemByFeatureId(@Param("featureId") int featureId);
	
	Feature findFeature(@Param("orderNum") Integer orderNum, @Param("moduleId") int moduleId, @Param("featureId") int featureId);
	
	Integer getFeatureMaxIdByFeatureType(@Param("moduleId") Integer moduleId);
	Integer getFeatureLastOrderNumByModuleId(@Param("moduleId") Integer moduleId);
	Feature getPreviousBanner(@Param("moduleId") Integer moduleId);
	
}
